package cn.zhukelili.generic;

/**
 * @description: 线程不安全的单例
 * @author: hhbeast
 * @since: 2018/7/29 11:22
 */
public class Singleton {
    private static final Singleton singleton = new Singleton();

    //限制产生多个对象
    private Singleton() {
    }

    //通过该方法获得实例对象
    public static Singleton getSingleton() {
        return singleton;
    }

    //类中其他方法，尽量是static
    public static void doSomething() {
    }
}
